import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int half = n/2;
        for(int i = half; i > 0 ; i--){
            if(isPrime(i) && isPrime(n-i)){
                System.out.println(i);
                System.out.println(n-i);
                break;
            }
        }
    }

    public static boolean isPrime(int num){
        for(int i = 2; i < num ; i++){
            if(num % i == 0) return false;
        }
        return true;
    }
}

